<template>
	<u-modal :show="showModel" :title="option.title" :content='option.content' showCancelButton @cancel="close" :confirmText="option.confirmText" :cancelText="option.cancelText"
		@confirm="confirm" width="550rpx" confirmColor="#FFFFFF" cancelColor="#FFFFFF">
			<slot></slot>
	</u-modal>
</template>

<script>
	export default {
		data() {
			return {
				showModel: false,
				option: {
					content: '',
					title: '',
					confirmText:this.$t("common.okText"),
					cancelText:this.$t("common.cancelText"),
				}
			};
		},
		methods: {
			show(data) {
				this.option = {...this.option,...data}
				this.showModel = true
			},
			close() {
				this.showModel = false
				this.option.close && this.option.close()
			},
			confirm(e) {
				this.option.confirm && this.option.confirm(this)
			}
		}
	};
</script>